import { Box } from "@chakra-ui/react";
import { Feature } from "./feature/FeatureList";
import LinePlot from "./charts/line/LinePlot";
import ScatterPlot from "./charts/scatter/ScatterPlot";
import HistogramContainer from "./charts/histogram/HistogramContainer";

interface Props {
  feature: Feature;
}

const Display = ({ feature }: Props) => {
  let display = null;

  switch (feature.name) {
    case "Line":
      display = <LinePlot />;
      break;
    case "Scatter":
      display = <ScatterPlot />;
      break;
    case "Histogram":
      display = <HistogramContainer />;
      break;
  }

  return <Box>{display}</Box>;
};

export default Display;
